AppCompatSpinner

constructor(@NonNull context: @NonNull Context)(source)

Construct a new spinner with the given context's theme.

Parameters

context

The Context the view is running in, through which it can access the current theme, resources, etc.


constructor(@NonNull context: @NonNull Context, mode: Int)(source)

Construct a new spinner with the given context's theme and the supplied mode of displaying choices. mode may be one of MODE_DIALOG or MODE_DROPDOWN.

Parameters

context

The Context the view is running in, through which it can access the current theme, resources, etc.

mode

Constant describing how the user will select choices from the spinner.

See also


constructor(@NonNull context: @NonNull Context, @Nullable attrs: @Nullable AttributeSet)(source)

Construct a new spinner with the given context's theme and the supplied attribute set.

Parameters

context

The Context the view is running in, through which it can access the current theme, resources, etc.

attrs

The attributes of the XML tag that is inflating the view.


constructor(@NonNull context: @NonNull Context, @Nullable attrs: @Nullable AttributeSet, defStyleAttr: Int)(source)

Construct a new spinner with the given context's theme, the supplied attribute set, and default style attribute.

Parameters

context

The Context the view is running in, through which it can access the current theme, resources, etc.

attrs

The attributes of the XML tag that is inflating the view.

defStyleAttr

An attribute in the current theme that contains a reference to a style resource that supplies default values for the view. Can be 0 to not look for defaults.


constructor(@NonNull context: @NonNull Context, @Nullable attrs: @Nullable AttributeSet, defStyleAttr: Int, mode: Int)(source)

Construct a new spinner with the given context's theme, the supplied attribute set, and default style. mode may be one of MODE_DIALOG or MODE_DROPDOWN and determines how the user will select choices from the spinner.

Parameters

context

The Context the view is running in, through which it can access the current theme, resources, etc.

attrs

The attributes of the XML tag that is inflating the view.

defStyleAttr

An attribute in the current theme that contains a reference to a style resource that supplies default values for the view. Can be 0 to not look for defaults.

mode

Constant describing how the user will select choices from the spinner.

See also


constructor(@NonNull context: @NonNull Context, @Nullable attrs: @Nullable AttributeSet, defStyleAttr: Int, mode: Int, popupTheme: Resources.Theme)(source)

Constructs a new spinner with the given context's theme, the supplied attribute set, default styles, popup mode (one of MODE_DIALOG or MODE_DROPDOWN), and the context against which the popup should be inflated.

Parameters

context

The context against which the view is inflated, which provides access to the current theme, resources, etc.

attrs

The attributes of the XML tag that is inflating the view.

defStyleAttr

An attribute in the current theme that contains a reference to a style resource that supplies default values for the view. Can be 0 to not look for defaults.

mode

Constant describing how the user will select choices from the spinner.

popupTheme

The theme against which the dialog or dropdown popup should be inflated. May be null to use the view theme. If set, this will override any value specified by Spinner_popupTheme.

See also